Skip to main content

createPost

To open the Predis.ai post creation and editing flow.

Usage

predis.createPost({
onPostPublish: function (err, data) {
console.log(err, data);
},
post_idea: "This is some brief for your post", // optional
business_details: { //optional
description: "Your business description goes here",
products: ["product 1 details", "product 2 details"],
audience: "Audience description goes here",
benefits: "Business's benefits for your audience go here"
},
media_type: ["single_image", "carousel", "video"] // optional
}
);
tip

Call the createPost method inside the on("ready") callback which ensures that the SDK is ready.

Parameters

NameDescriptionTypeRequired
onPostPublishFunction to receive data when a post is published from the editor. See onPostPublish for more details.Functionno
post_ideaUse this to populate the Post idea in the Create New flowStringNo
business_details.descriptionUse this to populate the Brand's Business description. Used in making posts in Business to Post typeStringNo
business_details.productsUse this to pass the Brand's products. Multiple products can be passed in an array. Used in making posts in Business to Post typeArrayNo
business_details.audienceUse this to pass the Brand's Audience description. Used in making posts in Business to Post typeStringNo
business_details.benefitsUse this to pass the Brand's Benefits description. Used in making posts in Business to Post typeStringNo
media_typeUsed if you want to restrict your users into making only particular type of post. Eg. Passing only single_image will only show image type in create post flow. Only the given values are possible - "single_image", "carousel", "video".ArrayNo